package com.uni.service;

import com.uni.dao.CommodityDao;
import com.uni.dao.CommodityDaoImpl;
import com.uni.entity.Commodity;
import com.uni.entity.CommodityType;

import java.util.List;

/**
 * --------------project-------------
 *
 * @Author Unirithe  - Mr.Chao
 * - CSDN:
 * https://blog.csdn.net/Unirithe
 * - GitHub:
 * https://github.com/unirithe
 * @create 2021/12/20 18:34
 * ------------------------------------------
 */
public class CommodityServiceImpl implements CommodityService{
    CommodityDao commodityDao = new CommodityDaoImpl();
    @Override
    public List<CommodityType> queryAllType() {
        return commodityDao.queryAllType();
    }

    @Override
    public boolean insertCommodity(Commodity commodity) {
        return commodityDao.insertCommodity(commodity);
    }

    @Override
    public List<Commodity> queryAll() {
        return commodityDao.queryAll();
    }

    @Override
    public String queryTypeById(int id) {
        return commodityDao.queryTypeById(id);
    }

    @Override
    public List<Commodity> query(int begin, int end, int tid) {
        return commodityDao.query(begin, end, tid);
    }

    @Override
    public int count() {
        return commodityDao.count();
    }

    @Override
    public int countByTypeId(int id) {
        return commodityDao.countByTypeId(id);
    }

    @Override
    public boolean insertAction(int uid, int cid) {

        return commodityDao.insertAction(uid, cid);
    }

    @Override
    public Commodity query(int id) {
        return commodityDao.query(id);
    }

    @Override
    public List<Commodity> queryByUid(int uid) {
        return commodityDao.queryByUid(uid);
    }

    @Override
    public boolean deleteCommodity(int cid) {
        return commodityDao.deleteCommodity(cid);
    }
}
